package com.jcu.itot;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.ActivityNotFoundException;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.DialogInterface.OnClickListener;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;

public class Flash_select extends Activity {
GridView gridView;
MediaPlayer mp;
static final String[] flash = new String[] { "flash_01","flash_02","flash_03","flash_04","flash_05"};
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.grid);
		
		 gridView = (GridView) findViewById(R.id.gridView1);
		 gridView.setAdapter(new FlashImageAdapter(this, flash));
		

		gridView.setOnItemClickListener(new OnItemClickListener() {
		
			@Override
			public void onItemClick(AdapterView<?> parent, View v, int position,
					long id) 
			{
				
				if(position==0)
				{
					
					Intent intent = new Intent(Flash_select.this,flsh.class);
					intent.putExtra("position", position);
					startActivity(intent);
										
				
				}
				if(position==1)
				{
					//video();
					Intent intent = new Intent(Flash_select.this, flsh_02.class);
					startActivity(intent);
				}
				
				if(position==2)
				{
					//video();
					Intent intent = new Intent(Flash_select.this, flsh_03.class);
					startActivity(intent);
				}
				if(position==3)
				{
					//video();
					Intent intent = new Intent(Flash_select.this, flsh_04.class);
					startActivity(intent);
				}
				if(position==4)
				{
					//video();
					Intent intent = new Intent(Flash_select.this, flsh_05.class);
					startActivity(intent);
				}
				
			}
		});
	}
	
	
	


		
	
	
	
	}

